import request from '@/utils/request.js'

// 所有频道
export const allChannels = () => request({
  url: '/v1_0/channels'
})

// 获取用户的频道
export const list = () => {
  return request({
    url: '/v1_0/user/channels'
  })
}

// 删除指定用户频道
export const del = (target) => {
  return request({
    method: 'DELETE',
    url: `/v1_0/user/channels/${target}`
  })
}

// 设置用户的频道
export const add = (channels) => {
  // console.log(channels);
  return request({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: {
      channels: [channels]
    }
  })
}
